Feature #2728
closedAPI: POST /api/hostgroups does not accept ancestry
Description
When trying to use the API to create hostgroups, POST /api/hostgroups does not accept a hostgroup[ancestry] as a parameter. This means a user cannot create nested hostgroups through the API.
The example json in the documentation for the API shows both hostgroup[ancestry] and hostgroup[parameters] being accepted on a post, but in the parameters below the example, neither of these are listed and indeed this is reflected in code at app/controllers/api/v1/hostgroups_controller.rb. PUT /api/hostgroups does not accept either of these fields either.
This greatly limits the usability of either of these routes unless you want to create un-nested host groups.
Updated by Joseph Magen over 11 years ago
- Status changed from New to Assigned
- Assignee set to Joseph Magen
Updated by Joseph Magen over 11 years ago
- Status changed from Assigned to Ready For Testing
The parameter :parent_id can be passed for PUT or POST.
It was missing from the API documentation and the following pull request fixes this
https://github.com/theforeman/foreman/pull/755
Updated by Joseph Magen over 11 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 5f7b64bd2d70057b752c9a6e171e4d5a11a1348f.